{template "header","blog"}
<script type="text/javascript">
            KindEditor.ready(function(K) {
                K.each({
                    'plug-align' : {
                        name : '对齐方式',
                        method : {
                            'justifyleft' : '左对齐',
                            'justifycenter' : '居中对齐',
                            'justifyright' : '右对齐'
                        }
                    },
                    'plug-order' : {
                        name : '编号',
                        method : {
                            'insertorderedlist' : '数字编号',
                            'insertunorderedlist' : '项目编号'
                        }
                    },
                    'plug-indent' : {
                        name : '缩进',
                        method : {
                            'indent' : '向右缩进',
                            'outdent' : '向左缩进'
                        }
                    }
                },function( pluginName, pluginData ){
                    var lang = {};
                    lang[pluginName] = pluginData.name;
                    KindEditor.lang( lang );
                    KindEditor.plugin( pluginName, function(K) {
                        var self = this;
                        self.clickToolbar( pluginName, function() {
                            var menu = self.createMenu({
                                    name : pluginName,
                                    width : pluginData.width || 100
                                });
                            K.each( pluginData.method, function( i, v ){
                                menu.addItem({
                                    title : v,
                                    checked : false,
                                    iconClass : pluginName+'-'+i,
                                    click : function() {
                                        self.exec(i).hideMenu();
                                    }
                                });
                            })
                        });
                    });
                });
                K.create('#content', {
                    themeType : 'qq',
                    items : [
                        'bold','italic','underline','fontname','fontsize','forecolor','hilitecolor','plug-align','plug-order','plug-indent','link'
                    ]
                });
            });
        </script>
<script type="text/javascript">
<!--
$(function(){
	var sampleTags = ['<?php echo implode($tag,'\',\'')?>'];
	$('#tag').tagit({
        availableTags: sampleTags
    });
});
//-->
</script>
<div class="main">
<form action="" method="POST">
<div class="row">
    <div class="text">标题：</div>
    <div class="input">
        <input type="text" name="title" id="title" class="title" value="{$blog['title']}"/>
    </div>
</div>
<div class="clear"></div>
<div class="row">
    <div class="text">内容：</div>
    <div class="input">
        <textarea id="content" name="content" style="width:700px;height:200px;visibility:hidden;">{$blog['content']}</textarea>
    </div>
</div>
<div class="clear"></div>
<div class="row">
    <div class="text">类别：</div>
    <div class="input">
	<select name="category" id="category">
	{loop $category $cat}
	<option value="{$cat['id']}"<?php if($cat['id'] == $blog['category']){echo 'selected="selected"';}?>>{$cat['cname']}</option>
	{/loop}
	</select>
	</div>
</div>
<div class="clear"></div>
<div class="row">
    <div class="text">标签：</div>
    <div class="input">
    <input type="text" name="tag" id="tag" class="title" value="{$blog['tag']}"/>
    </div>
</div>
<div class="clear"></div>
<div class="row">
    <div class="text">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
    <div class="input">
    <input type="hidden" name="id" value="{$blog['id']}"/>
    <input type="submit" value="提交" name="dosubmit" class="submit"/>
    &nbsp;&nbsp;&nbsp;&nbsp;<a href="{U('blog/index/lists')}">返 回</a>
    </div>
</div>
</form>
</div>
{template "footer","blog"}